package org.mobai.flow.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * 多人审批方式
 *
 * @author mobai
 */

@Getter
@AllArgsConstructor
public enum ApprovalMultiEnum {
    SEQUENTIAL("sequential", "多人审批方式-顺序审批"),
    JOINT("joint", "多人审批方式-并行审批"),
    SINGLE("single", "多人审批方式-任何人审批");

    private final String multi;
    private final String description;

    private static final Map<String, ApprovalMultiEnum> APPROVAL_MULTI_ENUM_MAP = new HashMap<>();

    static {
        for (ApprovalMultiEnum value : ApprovalMultiEnum.values()) {
            APPROVAL_MULTI_ENUM_MAP.put(value.getMulti(), value);
        }
    }

    public static ApprovalMultiEnum getByMulti(String multi) {
        return APPROVAL_MULTI_ENUM_MAP.get(multi);
    }


}
